package com.hunan.api.catv.action.prize;

import com.hunan.api.catv.action.BaseAction;
import com.hunan.api.catv.annotation.MemberAuth;
import com.hunan.api.catv.common.Api;
import com.hunan.api.catv.entity.Result;
import com.hunan.api.catv.service.biz.prize.PrizeBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author jiang zhuan
 * @version 1.0
 * @description 描述
 * @date 2021/5/10 0010
 * @package com.hunan.api.catv.action.prize
 * @company 湖南有线
 */
@RestController
@RequestMapping(Api.prize)
public class PrizeAction extends BaseAction {

    @Autowired
    PrizeBiz prizeBiz;

    @PostMapping("/accept")
    @MemberAuth
    public Result acceptOrAbort(HttpServletRequest request, Integer type) {
        return buildOK(prizeBiz.accept(getMemberId(request), type, getDeviceId(request), getRemoteIp(request)), "");
    }
}
